package ch.fusun.baron.core.service;

import ch.fusun.baron.core.injection.Inject;
import ch.fusun.baron.core.rmi.User;
import ch.fusun.baron.data.DataUpdate;

/**
 *
 */
public class UserLoggedInDataUpdate implements DataUpdate {

	private User user;
	private int id;
	@Inject
	private transient UserService userService;

	/**
	 * Kryo
	 */
	public UserLoggedInDataUpdate() {
	}

	/**
	 * @param user
	 *            The user
	 */
	public UserLoggedInDataUpdate(User user, int id) {
		this.user = user;
		this.id = id;
	}

	@Override
	public void update() {
		userService.login(user, id);
	}

}
